import EasyMahjong from "./easy";

export default function EazyGroup({
	list,
	margins,
	leftclick,
	rightlick,
	close,
}: {
	list: Array<number | string>;
	margins?: Array<number>;
	leftclick?: Function;
	rightlick?: Function;
	close?: Function;
}) {
	return list.map((id, index) => (
		<EasyMahjong
			key={`${index}`}
			margin={margins && margins.includes(index)}
			clickCards={(id: number) => {
				leftclick && leftclick(id, index);
			}}
			rightClick={(id: number) => {
				rightlick && rightlick(id, index);
			}}
			close={
				close
					? (id: number) => {
							close(id, index);
					  }
					: undefined
			}
			id={id}
		/>
	));
}
